import mongoose from 'mongoose';

const FriendHelpBookSchema = new mongoose.Schema(
  {
    bookid: { type: mongoose.Schema.Types.ObjectId, ref: 'Book' },
    need_num: Number, // 需要好友助力数量
    limit_time: Number, // 限定完成时间
    index: Number, // 排序
    create_time: Date
  },
  { versionKey: false }
);

FriendHelpBookSchema.index({ bookid: 1 });

const FriendHelpBook = mongoose.model('FriendHelpBook', FriendHelpBookSchema);

export { FriendHelpBook };
